package com.cslg.questionnaires.mapper;

import com.cslg.questionnaires.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.Map;

@Mapper
public interface StudentMapper{
    @Select("SELECT * FROM t_student WHERE stu_id = #{userId}")
    Student getStudentByuserId(String userId);

    @Select("SELECT stu_id,stu_name,major_name FROM t_student,t_clazz " +
            "WHERE t_student.clazz_name = t_clazz.clazz_name AND stu_name = #{Name}")
    ArrayList<Map> getDetailsByStudentName(String Name);

    @Select("SELECT stu_id,stu_name,major_name FROM t_student,t_clazz " +
            "WHERE t_student.clazz_name = t_clazz.clazz_name AND stu_name like #{Name}")
    ArrayList<Map> getDetailsByStudentPartName(String Name);
}
